package com.css.zfzx.fwsjcj;

import com.querydsl.jpa.impl.JPAQueryFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;

import javax.persistence.EntityManager;

@SpringBootApplication
@ComponentScan("com.css")
@EnableScheduling
public class FwsjcjApplication {

    public static void main(String[] args) {
        SpringApplication.run(FwsjcjApplication.class, args);
        System.out.println("项目启动成功！");
    }

    /**
     * 创建一个通用的查询工厂
     *
     * @param entityManager
     * @return
     */
    @Bean
    public JPAQueryFactory jpaQueryFactory(EntityManager entityManager) {
        return new JPAQueryFactory(entityManager);
    }

    /*@Bean
    public ThymeleafViewResolver thymeleafViewResolver(){
        return new ThymeleafViewResolver();
    }*/

}
